package com.hopu.oa.service.impl.mail;

import com.hopu.oa.dao.mail.AoaMailnumberDao;
import com.hopu.oa.dao.mail.mailDao;
import com.hopu.oa.entity.mail.AoaMailnumber;
import com.hopu.oa.entity.mail.Inmaillist;
import com.hopu.oa.entity.mail.Mailreciver;
import com.hopu.oa.entity.mail.Pagemail;
import com.hopu.oa.entity.management.AoaStatusList;
import com.hopu.oa.entity.management.AoaTypeList;
import com.hopu.oa.entity.plan.AttachmentList;
import com.hopu.oa.entity.process.AoaAttachmentList;
import com.hopu.oa.service.mail.mailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class mailServiceImpl implements mailService {
    @Autowired
    private mailDao mailDao;
    @Autowired
    private AoaMailnumberDao mailnumberDao;

    @Override
    public List<AoaMailnumber> selectAoaMailnumberSend(Integer userId) {
        return mailnumberDao.selectAoaMailnumberSend(userId);
    }

    @Override
    public int saveRead(Integer isRead, Integer mailId) {
        return mailDao.saveRead(isRead, mailId);
    }

    @Override
    public List<Pagemail> draft(String find, Integer page, Integer size, Integer userId) {
        return mailDao.draft(find, page, size, userId);
    }

    @Override
    public List<Pagemail> send(String find, Integer page, Integer size, Integer userId) {
        return mailDao.send(find, page, size, userId);
    }

    @Override
    public int updateEmail(Integer mailId) {
        return mailDao.updateEmail(mailId);
    }

    @Override
    public int sendEmail(Inmaillist inmaillist) {
        return mailDao.sendEmail(inmaillist);
    }

    @Override
    public int sendReciver(Mailreciver mailreciver) {
        return mailDao.sendReciver(mailreciver);
    }

    @Override
    public Pagemail WriteAttachmentListByFileId(Integer Id) {
        return mailDao.WriteAttachmentListByFileId(Id);
    }

    @Override
    public AttachmentList selectAttachmentListByFileId(Integer attachmentId) {
        return mailDao.selectAttachmentListByFileId(attachmentId);
    }

    @Override
    public Mailreciver selectByMailreciverbyMailId(Integer mailId, Integer userId) {
        return mailDao.selectByMailreciverbyMailId(mailId, userId);
    }

    @Override
    public Inmaillist selectByMailId(Integer mailId) {
        return mailDao.selectByMailId(mailId);
    }

    @Override
    public AoaAttachmentList selectAoaAttachmentListById(Integer attachmentId) {
        return mailDao.selectAoaAttachmentListById(attachmentId);
    }

    @Override
    public int saveShouDel(Integer isDel, Integer mailId, Integer userId) {
        return mailDao.saveShouDel(isDel, mailId, userId);
    }

    @Override
    public int saveDel(Integer isDel, Integer mailId) {
        return mailDao.saveDel(isDel, mailId);
    }


    @Override
    public List<AoaTypeList> selectTypeList() {
        return mailDao.selectTypeList();
    }

    @Override
    public List<AoaStatusList> selectStatusList() {
        return mailDao.selectStatusList();
    }

    @Override
    public List<AoaMailnumber> selectAoaMailnumber(Integer userId) {
        return mailnumberDao.selectAoaMailnumber(userId);
    }

    @Override
    public int setDel(Integer isDel, Integer mailId) {
        return mailDao.setDel(isDel, mailId);
    }

    @Override
    public Mailreciver findbyReciverIdAndmailId(Integer userId, Integer id) {
        return mailDao.findbyReciverIdAndmailId(userId, id);
    }

    @Override
    public List<Pagemail> recive(String find, Integer page, Integer size, Integer userId) {
        return mailDao.recive(find, page, size, userId);
    }

    @Override
    public List<Mailreciver> findByDelAndReciverId(Integer b, Integer userId, String userName) {
        return mailDao.findByDelAndReciverId(b, userId, userName);
    }

    @Override
    public int isRead(Integer userId, Integer mailId, Integer isRead) {
        return mailDao.isRead(userId, mailId, isRead);
    }

    @Override
    public int statEmail(Integer star, Integer mailId) {
        return mailDao.statEmail(star, mailId);
    }

    @Override
    public int deletEmail(Integer mailId) {
        return mailDao.deletEmail(mailId);
    }

    @Override
    public List<Pagemail> trashCan(String find, Integer page, Integer size, Integer userId, String userName) {
        return mailDao.trashCan(find, page, size, userId, userName);
    }

    @Override
    public List<Inmaillist> findByPushAndDelAndMailUserid(Integer bo, Integer isDel, Integer userId) {
        return mailDao.findByPushAndDelAndMailUserid(bo, isDel, userId);
    }

    @Override
    public List<Mailreciver> findByReadAndDelAndReciverId(Integer isRead, Integer isDel, Integer mailReciverId) {
        return mailDao.findByReadAndDelAndReciverId(isRead, isDel, mailReciverId);
    }
}
